package com.swt.gap.common;

import org.springframework.stereotype.Service;
import org.springframework.util.StringUtils;

@Service
public class PermissionService {
    public Boolean hasReadPerm(Integer userId, Integer creatorId, String password) {
        if (userId.equals(creatorId)){
            return true;
        } else {
            return StringUtils.isEmpty(password);
        }
    }

    public Boolean hasWritePerm(Integer userId, Integer creatorId) {
        return userId.equals(creatorId);
    }

}
